import { Component, OnInit, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
import { InputBoolean } from '../core/utils/convert';

export type lvTimelineMode = 'left' | 'right' | 'alternate' | 'tiled' | 'customize';
@Component({
  selector: 'lv-timeline',
  exportAs: 'lvTimeline',
  templateUrl: './timeline.component.html',
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TimelineComponent implements OnInit {
  @Input() lvFormat: string; // 日期格式

  @Input() lvMode: lvTimelineMode = 'left';

  @Input() @InputBoolean() lvReverse = false;

  constructor() {}

  initFormat(): void {
    this.lvFormat = 'yyyy-MM-dd HH:mm:ss';
  }

  ngOnInit(): void {
    // 默认格式化处理
    if (!this.lvFormat) {
      this.initFormat();
    }
  }
}
